import request from '@/utils/request'

// 查询地区列表
export function getAllAreas(registerType) {
  let data= JSON.stringify({
    "registerType":registerType,
    "areaProvinceCode": import.meta.env.VITE_AREA_PROVINCE_CODE
  });

  return request({
    url: '/rxsbopenapi/getAreaConfigList',
    method: 'post',
    data:data
  })
}

 
// 获取所有的申报类型
export function getAllSblx(data) {
  return request({
    url: '/rxsb/company',
    method: 'post',
    data: data
  })
}


//获取填报须知
export function getTbxz(noticeType,getList,noticeId) {
  let data= JSON.stringify({
    "noticeType":noticeType,
    "noticeId":noticeId,
    "getList": getList
  });

  return request({
    url: '/rxsbopenapi/tbxzContent',
    method: 'post',
    data: data
  })
}




//获取某个区域的申报说明
export function getAreaConfigInfo(area) {
  let data= JSON.stringify({
    "areaId":area.id,
    "areaProvinceCode":area.areaProvinceCode
  });

  return request({
    url: '/rxsbopenapi/getAreaConfigInfoById',
    method: 'post',
    data: data
  })
}


//获取某个填报的材料信息列表
export function getRegisterInfoMaterialsById(userId,area,areaRegisterNo) {
  let data= JSON.stringify({
    "userId":userId,
    "targetUrl":area.ext4,
    "areaRegisterNo": areaRegisterNo
  });

  return request({
    url: '/rxsbopenapi/getRegisterInfoMaterialsById',
    method: 'post',
    data: data
  })
}


// 写入填报信息到本地
export function saveRegisterInfo(data) {
  return request({
    url: '/rxsbopenapi/saveOneThingRecord',
    method: 'post',
    data: data
  })
}